import http from '../https'

const url = 'http://82.157.143.31:8080'
//全部数据查询
const home = (obj) => http({
    url: `${url}/drugMng/selectDrug`,
    method: 'get',
    params: {
        ...obj
    }
})
//删除
const del = (id) => http({
    url: `${url}/drugMng/deleteDrug`,
    method: 'post',
    data: {
        id
    }
})
//修改
const mod = (obj) => http({
    url: `${url}/drugMng/updateDrug`,
    method: 'post',
    data: obj,
    processData: false,
    contentType: false
})
//导出
const Myexport = () => http({
    url: `${url}/drugMng/export`,
    method: 'get',
    responseType: 'blob'
})

//增加
const add = (obj) => http({
    url: `${url}/drugMng/addDrug`,
    method: 'post',
    data: obj,
    processData: false,
    contentType: false
})
//状态下拉框
const option = () => http({
    url: `${url}/drugMng/selectStatus`,
    method: 'get'

})
//状态下拉框
const optiontw = () => http({
    url: `${url}/drugMng/selectDrugCls`,
    method: 'get'

})
export {
    home,
    del,
    mod,
    Myexport,
    add,
    option,
    optiontw
}